package be.novelfaces.showcase.webdriver.pages;

import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

import be.novelfaces.showcase.webdriver.pages.download.DownloadPage;
import be.novelfaces.showcase.webdriver.pages.home.HomePage;
import be.novelfaces.showcase.webdriver.util.NFBy;
import be.novelfaces.webdriver.BaseComponent;

public class HeaderToolbar extends BaseComponent {
	
	@FindBy(id = NFBy.HEADER_FORM + "homeButton")
	private WebElement homeButton;
	@FindBy(id = NFBy.HEADER_FORM + "downloadButton")
	private WebElement downloadButton;

	public HeaderToolbar() {
		super(NFBy.headerFormId("headerToolbar"));
	}
	
	public HomePage gotoHomePage() {
		homeButton.click();
		return new HomePage().assertArrivedAt();
	}
	
	public DownloadPage gotoDownloadPage() {
		downloadButton.click();
		return new DownloadPage().assertArrivedAt();
	}

}
